﻿
@{
    ViewBag.Title = "Add";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

@section styles{
    @Styles.Render("~/Content/kindeditor")
}

@section scripts{
    @Scripts.Render("~/bundles/kindeditor")
    <script type="text/javascript">
        KindEditor.ready(function (K) {
            K.create('#content', {
                urlType: 'relative',
                cssPath: '@Url.Content("~/content/prettify/prettify.css")',
                uploadJson: '@Url.Action("UploadFile", "Home", new { area="" })',
				@*fileManagerJson : '@Url.Action("UploadManage", "Voice")',*@
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
				},
                items: [
                    'source', '|', 'undo', 'redo', '|', 'preview', 'print', /*'template',*/ 'code', 'cut', 'copy', 'paste',
                    'plainpaste', /*'wordpaste',*/ '|', 'justifyleft', 'justifycenter', 'justifyright',
                    'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                    'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                    'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                    'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
                    /* 'flash', 'media', 'insertfile',*/ 'table', 'hr', /*'emoticons', 'baidumap',*/ 'pagebreak',
                    'anchor', 'link', 'unlink', /*'|', 'about'*/
                ]
            });
			prettyPrint();
        });
        $(function () {
            $(".ke-container").css("width", "");
            $(window).resize(function () {
                $(".ke-container").css("width", "");
            });
        })
    </script>
}

<section class="content-header">
    <h1>编辑器<small>在线HTML文档编辑器</small></h1>
    <ol class="breadcrumb">
        <li><a href="@Url.Action("Index","Home")"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li class="active">编辑器</li>
    </ol>
</section>
<section class="content">
    <form role="form" name="example" method="post" action="Add" class="form-horizontal">
        <div class="form-group">
            <label for="name" class="col-sm-1 control-label">标题</label>
            <div class="col-sm-11">
                <input type="text" class="form-control" id="name" name="name" placeholder="请输入标题">
            </div>
        </div>
        <div class="form-group">
            <label for="content" class="col-sm-1 control-label">内容</label>
            <div class="col-sm-11">
                <textarea id="content" name="content" class="form-control" placeholder="请输入内容"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-1 col-sm-11">
                <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>
</section>

